<div class="user_content" xmlns:th="http://www.w3.org/1999/xhtml">
    <div class="x_panel">
    <form action="#"  id="findForm" method="post" class="form-horizontal" role="form">
        <div class="row">
            <div class="form-group">
                <input type="hidden" id="orgIdBack" th:value="${orgId}" />
                <label class="col-sm-1 control-label">登录账号：</label>
                <div class="col-sm-3" >
                    <input type="text" class="form-control"  name="loginName" th:value="${loginName}" />
                </div>
                <label class="col-sm-1 control-label">人员姓名：</label>
                <div class="col-sm-3" >
                    <input type="text" class="form-control"  name="empName" th:value="${empName}" />
                </div>
                <label class="col-sm-1 control-label">角色名称：</label>
                <div class="col-sm-3" >
                    <select class="form-control" name="roleId" id="roleId">
                        <option value="">请选择...</option>
                        <option th:each="info,iterStat : ${role}" th:text="${info.roleName}" th:value="${info.roleId}">Combo Box</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="form-group">
                <label class="col-sm-1 control-label">所属部门：</label>
                <div class="col-sm-3" >
                    <input type="text" class="form-control" name="orgName" th:value="${orgName}"/>
                </div>
                <div class="col-md-5 checkbox checkbox-info" style="margin-top: 6px;margin-left: 18px">
                    <input type="checkbox" name="sts" th:value="${sts}" /><label style="width: 180px">是否显示已删除人员</label>
                </div>
                <div class="">
                    <button style=" margin-right: 10px;"  type="button" name="insert" class="btn btn-primary pull-right" onclick="insertEmp()">增加</button>
                    <button  type="button" class="btn btn-primary pull-right" onclick="find()">查询</button>
                </div>
            </div>
        </div>
    </form>

    </div>
    <div class="row">
        <div class="form-group">
            <div class="col-sm-1" >

            </div>
        </div>
    </div>
    <div class="row" style="margin-top: 20px">
        <div class="table-responsive">
            <table class="table table-striped jambo_table bulk_action">
                <thead>
                <tr class="headings">
                    <th class="column-title" style="display: table-cell;">人员ID</th>
                    <th class="column-title" style="display: table-cell;">人员编号</th>
                    <th class="column-title" style="display: table-cell;">登录账号</th>
                    <th class="column-title" style="display: table-cell;">人员姓名</th>
                    <th class="column-title" style="display: table-cell;">使用状态</th>
                    <th class="column-title" style="display: table-cell;">联系方式</th>
                    <th class="column-title" style="display: table-cell;">操作</th>
                </tr>
                </thead>

                <tbody>
                <tr  class="even pointer" th:each="data,iterStat : ${datas.content}" >
                    <td style="vertical-align: middle;" th:text="${iterStat.count}">0</td>
                    <td style="vertical-align: middle;" th:text="${data.empCode}">23100</td>
                    <td style="vertical-align: middle;" th:text="${data.loginName}">账号</td>
                    <td style="vertical-align: middle;" th:text="${data.empName}">admin</td>
                    <td style="vertical-align: middle;" id="sts" th:text="${data.sts}=='1'?'启用':'停用'"></td>
                    <td style="vertical-align: middle;" th:text="${data.contactNumber}">手机号</td>
                    <td style="vertical-align: middle;">
                        <button class="fa fa-pencil-square-o btn btn-round btn-default" type="button"  name="see" th:id="${data.empId}"  onclick="see(this)">查看</button>
                        <button class="fa fa-minus-circle btn btn-round btn-default" name="delete" th:id="${data.empId}" type="button"  th:if="${data.sts=='1'}" onclick="deleteEmp(this)">删除</button>
                        <button class="fa fa-mail-reply-all btn btn-round btn-default" name="reply"  type="button" th:id="${data.empId}" th:if="${data.sts=='0'}" onclick="reply(this)">恢复</button>
                        <button class="fa fa-pencil-square-o btn btn-round btn-default" type="button"  name="updatePwd" th:id="${data.empId}"  onclick="updatePwd(this)">重置密码</button>

                        <!--<button class="fa fa-sign-out btn btn-round btn-default" name="before" type="button" th:id="${data.empId}"  onclick="before(this)" >初始化密码</button>-->
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div id="pagination" class="col-md-12 pagination" th:replace="pagination :: pagination">
        </div>
    </div>

</div>

<script type="text/javascript" th:inline="javascript">

    $(function () {//默认加载
        var roleId=[[${roleId}]];
        $("#roleId option").each(function(){//遍历所有的角色
            if($(this).val()==roleId){
                $(this).attr("selected", true);
            }
        });
        if($("input[name=sts]").val()=="1"){
            $("input[name='sts']").attr("checked",true);
        }

    });
    $("table").find("tr").each(function () {
        var text=$(this).children('td:eq(4)').text();
        var text2=$(this).children('td:eq(5)').text();
        var reg=/,/g;
        var html=text.replace(reg,"<br/>")
        var html2=text2.replace(reg,"<br/>")
        $(this).children('td:eq(4)').html(html);
        $(this).children('td:eq(5)').html(html2);
    });
    /*<![CDATA[*/
    $(function () {//默认加载
        $("#roleId option").each(function(){//遍历所有的角色
            if($(this).val()==$('#roleIdBack').val()){
                $(this).attr("selected", true);
            }
        });
        if($("input[name=sts]").val()=="1"){
            $("input[name='sts']").attr("checked",true);
        }
        if($("input[name=orgType]").val()=="14"){
            $("input[name=orgType]").attr("checked",true);
        }

    });

    $("#pagination").load("../pagination.html",function (res) {
        return true;
    });
    function insertEmp() {//跳转到新增页
        $.goTo(/*[[@{toEmpInsert}]]*/"./emp_insert.html");
    }
    /*]]>*/
</script>


